package cart.haiboinvest.com.haibocart;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import com.alipear.appbase.BaseApp;
import com.alipear.uibase.BaseActivity;
import com.alipear.uibase.BaseCommonActivity;
import com.alipear.uibase.BaseFragment;
import com.alipear.uibase.BaseFramgmentActivity;

/**
 * Created by zoulinlin on 16/4/4.
 */
public class SubActivity extends BaseCommonActivity {

    public static Intent generateActivity(Activity content, Object fragment, Bundle params) {
        Intent intent = new Intent(content, SubActivity.class);
        if (params != null) {
            intent.putExtras(params);
        }
        if (fragment !=  null) {
            String classKey = fragment.getClass().getName();
            intent.putExtra(FRAGMENT_CLASS_KEY, classKey);
            BaseApp.getCurApp().getGlobalParams().put(classKey, fragment);
        }
        return intent;
    }
}
